import request from '@/utils/request';

// 登陆接口
export function login(principal){
    return request.post('/login?grant_type=mini_app', {principal});
}
export function loadOrderData(status){
    return request.get('/p/myOrder/myOrder',{current:1,size:10,status})
}
export function getCount(){
    return request.get('/p/user/collection/count')
}
//加载订单数字
export function getOrderCount(){
    return request.get('/p/myOrder/orderCount')
}
//获取验证码
export function getVerification(mobile){
    return request.post('/p/sms/send',{mobile})
}
//获取订单详情
export function getOrderNumber(orderNumber){
    return request.get('/p/myOrder/orderDetail',{orderNumber})
}
//取消订单
export function cancleOrder(ordernum){
    return request.put('/p/myOrder/cancel/'+ordernum)
}
//查询收藏量
export function getCollection({current,size}){
    return request.get(`/p/user/collection/prods?current=${current}&size=${size}`)
}
//发起付款
export function orderPay({payType=1,orderNumbers}){
    return request.post('/p/order/pay',{payType,orderNumbers})
}
//绑定手机号
export function bindingPhone(options){
    return request.put('/user/registerOrBindUser',{options})
}